/* Sentinel - IRC Statistical and Operator Services
** event.h - event handling system
**
** Copyright W. Campbell and others.  See README for more details
** Some code Copyright: Jonathan George, Kai Seidler, ircd-hybrid Team,
**                      IRCnet IRCD developers.
**
** $Id: event.h 7 2010-02-01 19:17:42Z dubkat $
*/

/* Original Header: */

/*
*  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
*  event.h: The ircd event header.
*
*  Copyright (C) 2002 by the past and present ircd coders, and others.
*
*  The original never had a GPL REMOVED with pleasure -db
*
*  #Id: event.h,v 1.3 2002/09/19 22:14:59 bill Exp #
*/

#ifndef __EVENT_H__
#define __EVENT_H__

/*
 * How many event entries we need to allocate at a time in the block
 * allocator. 16 should be plenty at a time.
 */
#define	MAX_EVENTS	50

#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif

typedef void EVH(void *);

struct ev_enum
{
  const char *name;
  time_t next;
};

extern void eventAdd(const char *name, EVH *func, void *arg, time_t when);
extern void eventAddIsh(const char *name, EVH *func, void *arg, time_t delta_ish);
extern void eventRun(void);
extern void eventInit(void);
extern void eventDelete(EVH *func, void *);
extern int eventFind(EVH *func, void *);
extern void set_back_events(time_t);

extern const char *get_last_event_ran(void);
void start_enumeration(void);
void end_enumeration(void);
struct ev_enum *enumerate_events(void);

#endif
